@extends('admin.layout.index')

@section('content')
<div class="mws-panel">
    <div class="mws-panel-header">
        <span>商品添加</span>
    </div>
    <div class="mws-panel-body no-padding">
        <form class="mws-form" action="/admin/cate/update" method="post">
            <input type="hidden" name="id" value="{{ $res['cid'] }}">
        	{{ csrf_field() }}
            <div class="mws-form-inline">
                <div class="mws-form-row">
                    <label class="mws-form-label">商品名称</label>
                    <div class="mws-form-item">
                        <input type="text" name="name" value="{{ $res['name'] }}" style="width:400px">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">所属商品</label>
                    <div class="mws-form-item">
                        <select name="pid" style="width:400px">
                            <option>--请选择--</option>
                            @foreach($data as $k => $v)
                            <option value="{{ $v['cid'] }}"  @if($res['pid'] == $v['cid']) selected @endif>{{ $v['name'] }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
            </div>
            <div class="mws-button-row">
                <input type="submit" value="添加" class="btn btn-danger">
                <input type="reset" value="重置" class="btn btn-danger">
            </div>
        </form>
    </div>
</div>
@endsection